keepalived的日志在哪里、配置keepalived日志路径 |
您所在的位置:网站首页 › lvs 日志 › keepalived的日志在哪里、配置keepalived日志路径 |
前言
环境:centos 7.9 keepalived-2.2.7 keepalived默认日志路径默认情况下,不管yum安装的keepalived还是源码编译安装的keepalived,其都是受systemd管理的,所以日志可以这样看: systemctl status keepalived.service -l journalctl -u keepalived.service -f tail -22f /var/log/messages | grep Keepalived 修改keepalived日志路径默认的日志路径太不友好,可以让keepalived单独输出日志到指定文件,如下配置: keepalived的环境变量配置默认在 yum 安装的在 /etc/sysconfig/keepalived ,源码编译安装的在/usr/local/keepalived/etc/sysconfig/keepalived [root@node2 ~]# vim /usr/local/keepalived/etc/sysconfig/keepalived # Options for keepalived. See `keepalived --help' output and keepalived(8) and # keepalived.conf(5) man pages for a list of all options. Here are the most # common ones : # # --vrrp -P Only run with VRRP subsystem. # --check -C Only run with Health-checker subsystem. # --dont-release-vrrp -V Dont remove VRRP VIPs & VROUTEs on daemon stop. # --dont-release-ipvs -I Dont remove IPVS topology on daemon stop. # --dump-conf -d Dump the configuration data. # --log-detail -D Detailed log messages. # --log-facility -S 0-7 Set local syslog facility (default=LOG_DAEMON) # KEEPALIVED_OPTIONS="-D -S 0" #改这一句,添加-S 0 [root@node2 ~]# vim /etc/rsyslog.conf #在下面这一行后面添加 # Save boot messages also to boot.log local7.* /var/log/boot.log #添加这一行 # save keepalived log to keepalived.log local0.* /var/log/keepalived.log [root@node1 sysconfig]# systemctl restart rsyslog #重启rsyslog [root@node1 sysconfig]# systemctl restart keepalived #重启keepalived [root@node1 sysconfig]# tail -222f /var/log/keepalived.log #keepalived的日志已经成功指定到我们定义的文件了 Oct 15 20:49:20 node1 Keepalived[109485]: Starting Keepalived v2.2.7 (01/16,2022) Oct 15 20:49:20 node1 Keepalived[109485]: Running on Linux 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 (built for Linux 3.10.0) Oct 15 20:49:20 node1 Keepalived[109485]: Command line: '/usr/local/keepalived/sbin/keepalived' '-D' '-S' '0' Oct 15 20:49:20 node1 Keepalived[109485]: WARNING - using deprecated default config file '/etc/keepalived/keepalived.conf' - please move to '/usr/local/etc/keepalived/keepalived.conf' Oct 15 20:49:20 node1 Keepalived[109485]: Opening file '/etc/keepalived/keepalived.conf'. Oct 15 20:49:20 node1 Keepalived[109485]: Configuration file /etc/keepalived/keepalived.conf Oct 15 20:49:20 node1 Keepalived[109486]: NOTICE: setting config option max_auto_priority should result in better keepalived performance Oct 15 20:49:20 node1 Keepalived[109486]: Starting VRRP child process, pid=109487 Oct 15 20:49:20 node1 Keepalived_vrrp[109487]: Registering Kernel netlink reflector Oct 15 20:49:20 node1 Keepalived_vrrp[109487]: Registering Kernel netlink command channel Oct 15 20:49:20 node1 Keepalived_vrrp[109487]: SECURITY VIOLATION - scripts are being executed but script_security not enabled. Oct 15 20:49:20 node1 Keepalived_vrrp[109487]: Assigned address 192.168.118.132 for interface ens33 Oct 15 20:49:20 node1 Keepalived_vrrp[1 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |